Skip to content

fix(estimation): let underflowed particles recover - #276

Draft
fzlzjerry wants to merge 1 commit into
kmolan:mainfrom
fzlzjerry:fix/particle-weight-underflow
Draft

fix(estimation): let underflowed particles recover#276
fzlzjerry wants to merge 1 commit into
kmolan:mainfrom
fzlzjerry:fix/particle-weight-underflow

Conversation

@fzlzjerry

Copy link
Copy Markdown

Fixes #205

What & why

When normalization rounds an individual particle's weight to zero, the next update currently feeds ln(0) into its log-score and makes that particle permanently impossible. Use T::MIN_POSITIVE only for an exactly zero prior weight, preserving the existing numerical path for every representable weight while allowing a later observation to revive an underflowed particle. The public-API regression drives one particle to a displayed zero, reverses the evidence without resampling, and verifies that it becomes dominant.

Checklist

  • cargo test + cargo clippy --all-targets clean locally
  • New public APIs have a doc example (no new public API)
  • No unwrap/expect/panic on library paths (typed errors instead)

Validation

  • cargo test -p multicalc --features alloc estimation::particle_filter
  • cargo test -p multicalc
  • cargo test -p multicalc --features alloc
  • cargo test -p multicalc --all-features --doc
  • cargo clippy -p multicalc --all-targets --features alloc -- -D warnings
  • cargo fmt --all -- --check
  • RUSTDOCFLAGS='-D warnings' cargo doc -p multicalc --no-deps --all-features
  • git diff --check

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the first PR! 🎉 You'll get a first review within 48 h. CI runs the 5-target matrix — a budget-gate failure isn't your fault, see ci/README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let a particle recover after its weight underflows to zero

1 participant